<template>
  <view class="flex-row justify-between align-center">
    <view class="flex-row align-center">
      <image class="block title-icon" :src="src + titleImg" />
      <text class="text-36 color-t1 text-bold">{{ title }}</text>
    </view>
    <image v-if="!noMore" :src="src + close" class="block full-screen" @click="click" />
  </view>
</template>

<script>
export default {
  name: 'ChartTitle',
  props: {
    title: {
      type: String,
      default: ''
    },
    noMore: {
      type: Boolean,
      default: false
    },
    full: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      src: 'https://tbb-file.oss-cn-shenzhen.aliyuncs.com/tbb_admin_app/icon/',
      titleImg: 'icon_title.svg',
      close: 'icon_full_screen.svg'
    }
  },
  created() {
    if (this.full) {
      this.titleImg = 'icon_title_full.svg'
      this.close = 'icon_zoom_out.svg'
    }
  },
  methods: {
    click() {
      this.$emit('click')
    }
  }
}
</script>

<style scoped lang="scss">
@import "../index";
</style>
